package com.aaa.service.yy.impl;

import com.aaa.dao.yy.TesterSdsDao;

import com.aaa.pojo.yy.TesterSds;
import com.aaa.service.yy.TesterSdsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TesterSdsServiceImpl implements TesterSdsService {
    @Autowired
    private TesterSdsDao testerSdsDao;
    @Override
    public List<TesterSds> findAll() {
        List<TesterSds> testerSds = testerSdsDao.findAll();
        return testerSds;
    }

    @Override
    public List<TesterSds> findAll1(String page, String limit) {
        int pageInt = Integer.parseInt(page);
        int limitInt = Integer.parseInt(limit);
        int start = (pageInt - 1) * limitInt;
        List<TesterSds> all1 = testerSdsDao.findAll1(start,limitInt);
        return all1;
    }

    @Override
    public int findCount() {
        return testerSdsDao.findCount();
    }

    @Override
    public int deleteId(String idList) {
        return testerSdsDao.deleteId(Integer.parseInt(idList));
    }

    @Override
    public int deleteList(List<String> idList) {
        return testerSdsDao.deleteList(idList);
    }

    @Override
    public TesterSds insert(TesterSds testerSds) {
        testerSdsDao.insert(testerSds);
        return testerSds;
    }
}
